package Gerrit::Query;
use Gerrit::API;
use 5.018;
use warnings;
use Data::Dumper;
sub getInfo
{
	my ($id, $cb) = @_;
	warn "getInfo $id";
	Gerrit::API::getChangeInfo($id, sub {
		my ($ret) = @_;
		my $info = {};
		unless ( $ret->{error} )
		{
			#warn Dumper $ret->{result};
			my $status = $ret->{result}{status} // "unknown";
			$info = {info => "status $status", error => 0 };
		}
		else
		{
			$info = {error => 1};
		}
		$cb->($info);
		
	});
}

1;
